# Contributor:
# Maintainer: Julien Voisin <julien.voisin@dustri.org>
pkgname=hardened-malloc
pkgver=13
pkgrel=0
pkgdesc="Hardened allocator designed for modern systems."
url="https://github.com/GrapheneOS/hardened_malloc"
arch="x86_64 aarch64"
license="MIT"
checkdepends="python3"
source="$pkgname-$pkgver.tar.gz::https://github.com/GrapheneOS/hardened_malloc/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/${pkgname/-/_}-$pkgver"

build() {
	make VARIANT=light
	make VARIANT=default

}

check() {
	make test
}

package() {
	mkdir -p "$pkgdir"/usr/lib/
	install -m755 out/libhardened_malloc.so "$pkgdir"/usr/lib/
	install -m755 out-light/libhardened_malloc-light.so "$pkgdir"/usr/lib/

}

sha512sums="
793252e3fa34c5aa3c672b182a204014b52ba52a693cd72fae77d6c537d364ab8e65db702e40528d6a51e7ffb945f8a28289245a2f23d8cc6b8253b56660dd9d  hardened-malloc-13.tar.gz
"
